﻿/*
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2006
' by Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions 
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
' DEALINGS IN THE SOFTWARE.
 */

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Xml;
using System.Web;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Search;
using ServiceReference1;
using System.Text;
using System;
using System.IO;

namespace Triax.Modules.ThongKeATLD
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Controller class for the Category
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class ThongkeATLDController : ISearchable, IPortable
    {

    #region Constructors

        public ThongkeATLDController()
        {
        }

    #endregion

    #region Public Methods

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// adds an object to the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="objCategory">The CategoryInfo object</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        /// 
        public List<Triax.Modules.ThongKeATLD.DonViHanhChinhInfo> getComment(string idata)
        {
            ServiceReference1.BIPortalClient client = new ServiceReference1.BIPortalClient();

            //  ServiceReference1.BIPortalClient client = new BIPortalClient();
            //  string _DBName = "HuyHoangCenter;HuyHoangSGCenter;BachKhoaCenter;ThanhVinh1Center;ThanhVinh2Center";
            List<Triax.Modules.ThongKeATLD.DonViHanhChinhInfo> listobject = new List<Triax.Modules.ThongKeATLD.DonViHanhChinhInfo>();

            try
            {
                client.ClientCredentials.Windows.ClientCredential.UserName = "other";
                client.ClientCredentials.Windows.ClientCredential.Password = "123";
                DateTime now = DateTime.Now;

                //      string xml = client.ThongTinTongTheOut(_DBName, now.AddDays(-1), now, false);
                string xml = client.CommentByIdataOut(idata);

                

                Stream stream = StringToStream(xml);
                DataSet ds = new DataSet();
                ds.ReadXml(stream);
                DataTable dt = ds.Tables[0];
                string vl = "";
                string res = "";
                bool checkk = false;
                int count = 1;
                foreach (DataRow row in dt.Rows)
                {
                    //IData, Product, LikeNumber, CommentNumber, LinkImage, Score
                    //User, Content, Time
                    string User = "";
                    string Content = "";
                    string Time = "";
                    int LikeNumber = (int)0;
                    int CommentNumber = (int)0;
                    int Score = (int)0;
                    string LinkImage = "";
                    // Row: Name, Month,Year,Amount
                    if (vl != "")
                        checkk = true;
                    if (row != null)
                    {
                        if (row["User"] is string)
                            User = row["User"].ToString();
                        if (row["Content"] is string)
                            Content = row["Content"].ToString();
                        if (row["Time"] is string)
                            Time = row["Time"].ToString();


                        Triax.Modules.ThongKeATLD.DonViHanhChinhInfo objTD = new ThongKeATLD.DonViHanhChinhInfo();
                        objTD.code = User;
                        objTD.title = Content;
                        objTD.temp_string1 = Time;


                        listobject.Add(objTD);
                    }
                }

                return listobject;

            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public static Stream StringToStream(string str)
        {
            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);
            writer.Write(str);
            writer.Flush();
            stream.Position = 0;
            return stream;
        }
        // Dơn vi hành chính
        public void AddDonViHanhChinh(Triax.Modules.ThongKeATLD.DonViHanhChinhInfo obj)
        {
          //  if (obj.DonViHanhChinhName.Trim() != "")
            {
               DataProvider.Instance().AddDonViHanhChinh(obj.ModuleId, 
           
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate

                
                );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteDonViHanhChinh(int ModuleId, int DonViHanhChinhId)
        {
            DataProvider.Instance().DeleteDonViHanhChinh(ModuleId, DonViHanhChinhId);
        }

        public DonViHanhChinhInfo GetDonViHanhChinh(int ModuleId, int DonViHanhChinhId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.DonViHanhChinhInfo>(DataProvider.Instance().GetDonViHanhChinh(ModuleId, DonViHanhChinhId));
        }

        public List<DonViHanhChinhInfo> GetDonViHanhChinhs(int ModuleId)
        {
            return CBO.FillCollection<DonViHanhChinhInfo>(DataProvider.Instance().GetDonViHanhChinhs(ModuleId));
        }

        public List<DonViHanhChinhInfo> GetDonViHanhChinhOthers()
        {
            return CBO.FillCollection<DonViHanhChinhInfo>(DataProvider.Instance().GetDonViHanhChinhOthers());
        }

        public List<NguyenNhanChinhInfo> GetNguyenNhanChinhOthers()
        {
            return CBO.FillCollection<NguyenNhanChinhInfo>(DataProvider.Instance().GetNguyenNhanChinhOthers());
        }


        public void UpdateDonViHanhChinh(DonViHanhChinhInfo obj)
        {
         //   if (obj.DonViHanhChinhName.Trim() != "")
            {
                DataProvider.Instance().UpdateDonViHanhChinh(obj.ModuleId,

                obj.id,
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<DonViHanhChinhInfo> GetDonViHanhChinhsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<DonViHanhChinhInfo>(DataProvider.Instance().GetDonViHanhChinhsByCond(ModuleId, Cond, Sql));
        }

        // end don vi hanh chinh
        // DOn vi KH

        public void AddDonViKinhTeHCSN(Triax.Modules.ThongKeATLD.DonViKinhTeHCSNInfo obj)
        {
            //  if (obj.DonViKinhTeHCSNName.Trim() != "")
            {
                DataProvider.Instance().AddDonViKinhTeHCSN(obj.ModuleId,

 obj.code,
 obj.title,
 obj.ParentId,
 obj.Description,
 obj.temp_double1,
 obj.temp_double2,
 obj.temp_string1,
 obj.temp_string2,
 obj.temp_string3,
 obj.temp_int1,
 obj.temp_int2,
 obj.temp_int3,
 obj.CreatedByUser,
 obj.CreatedDate,
 obj.UpdatedByUser,
 obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteDonViKinhTeHCSN(int ModuleId, int DonViKinhTeHCSNId)
        {
            DataProvider.Instance().DeleteDonViKinhTeHCSN(ModuleId, DonViKinhTeHCSNId);
        }

        public DonViKinhTeHCSNInfo GetDonViKinhTeHCSN(int ModuleId, int DonViKinhTeHCSNId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.DonViKinhTeHCSNInfo>(DataProvider.Instance().GetDonViKinhTeHCSN(ModuleId, DonViKinhTeHCSNId));
        }

        public List<DonViKinhTeHCSNInfo> GetDonViKinhTeHCSNs(int ModuleId)
        {
            return CBO.FillCollection<DonViKinhTeHCSNInfo>(DataProvider.Instance().GetDonViKinhTeHCSNs(ModuleId));
        }

        public void UpdateDonViKinhTeHCSN(DonViKinhTeHCSNInfo obj)
        {
            //   if (obj.DonViKinhTeHCSNName.Trim() != "")
            {
                DataProvider.Instance().UpdateDonViKinhTeHCSN(obj.ModuleId,

                obj.id,
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<DonViKinhTeHCSNInfo> GetDonViKinhTeHCSNsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<DonViKinhTeHCSNInfo>(DataProvider.Instance().GetDonViKinhTeHCSNsByCond(ModuleId, Cond, Sql));
        }

        // end DonViKinhTeHCSN

        // Nganh kinhj te

        public void AddNghanhKinhTe(Triax.Modules.ThongKeATLD.NghanhKinhTeInfo obj)
        {
            //  if (obj.NghanhKinhTeName.Trim() != "")
            {
                DataProvider.Instance().AddNghanhKinhTe(obj.ModuleId,

 obj.code,
 obj.title,
 obj.ParentId,
 obj.Description,
 obj.temp_double1,
 obj.temp_double2,
 obj.temp_string1,
 obj.temp_string2,
 obj.temp_string3,
 obj.temp_int1,
 obj.temp_int2,
 obj.temp_int3,
 obj.CreatedByUser,
 obj.CreatedDate,
 obj.UpdatedByUser,
 obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteNghanhKinhTe(int ModuleId, int NghanhKinhTeId)
        {
            DataProvider.Instance().DeleteNghanhKinhTe(ModuleId, NghanhKinhTeId);
        }

        public NghanhKinhTeInfo GetNghanhKinhTe(int ModuleId, int NghanhKinhTeId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.NghanhKinhTeInfo>(DataProvider.Instance().GetNghanhKinhTe(ModuleId, NghanhKinhTeId));
        }

        public List<NghanhKinhTeInfo> GetNghanhKinhTes(int ModuleId)
        {
            return CBO.FillCollection<NghanhKinhTeInfo>(DataProvider.Instance().GetNghanhKinhTes(ModuleId));
        }

        public void UpdateNghanhKinhTe(NghanhKinhTeInfo obj)
        {
            //   if (obj.NghanhKinhTeName.Trim() != "")
            {
                DataProvider.Instance().UpdateNghanhKinhTe(obj.ModuleId,

                obj.id,
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<NghanhKinhTeInfo> GetNghanhKinhTesByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<NghanhKinhTeInfo>(DataProvider.Instance().GetNghanhKinhTesByCond(ModuleId, Cond, Sql));
        }

        // Nghe nghiep

        public void AddNgheNghiep(Triax.Modules.ThongKeATLD.NgheNghiepInfo obj)
        {
            //  if (obj.NgheNghiepName.Trim() != "")
            {
                DataProvider.Instance().AddNgheNghiep(obj.ModuleId,

 obj.code,
 obj.title,
 obj.ParentId,
 obj.Description,
 obj.temp_double1,
 obj.temp_double2,
 obj.temp_string1,
 obj.temp_string2,
 obj.temp_string3,
 obj.temp_int1,
 obj.temp_int2,
 obj.temp_int3,
 obj.CreatedByUser,
 obj.CreatedDate,
 obj.UpdatedByUser,
 obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteNgheNghiep(int ModuleId, int NgheNghiepId)
        {
            DataProvider.Instance().DeleteNgheNghiep(ModuleId, NgheNghiepId);
        }

        public NgheNghiepInfo GetNgheNghiep(int ModuleId, int NgheNghiepId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.NgheNghiepInfo>(DataProvider.Instance().GetNgheNghiep(ModuleId, NgheNghiepId));
        }

        public List<NgheNghiepInfo> GetNgheNghieps(int ModuleId)
        {
            return CBO.FillCollection<NgheNghiepInfo>(DataProvider.Instance().GetNgheNghieps(ModuleId));
        }

        public List<NgheNghiepInfo> GetNgheNghiepOthers()
        {
            return CBO.FillCollection<NgheNghiepInfo>(DataProvider.Instance().GetNgheNghiepOthers());
        }

        public List<NghanhKinhTeInfo> GetNghanhKinhTeOthers()
        {
            return CBO.FillCollection<NghanhKinhTeInfo>(DataProvider.Instance().GetNghanhKinhTeOthers());
        }

        public List<YTGChanThuongInfo> GetYTGChanThuongOthers()
        {
            return CBO.FillCollection<YTGChanThuongInfo>(DataProvider.Instance().GetYTGChanThuongOthers());
        }

        public List<DonViKinhTeHCSNInfo> GetDonViKinhTeHCSNOthers()
        {
            return CBO.FillCollection<DonViKinhTeHCSNInfo>(DataProvider.Instance().GetDonViKinhTeHCSNOthers());
        }
        
        

        public void UpdateNgheNghiep(NgheNghiepInfo obj)
        {
            //   if (obj.NgheNghiepName.Trim() != "")
            {
                DataProvider.Instance().UpdateNgheNghiep(obj.ModuleId,

                obj.id,
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<NgheNghiepInfo> GetNgheNghiepsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<NgheNghiepInfo>(DataProvider.Instance().GetNgheNghiepsByCond(ModuleId, Cond, Sql));
        }

        // Nguyen nhan chinh

        public void AddNguyenNhanChinh(Triax.Modules.ThongKeATLD.NguyenNhanChinhInfo obj)
        {
            //  if (obj.NguyenNhanChinhName.Trim() != "")
            {
                DataProvider.Instance().AddNguyenNhanChinh(obj.ModuleId,

 obj.code,
 obj.title,

 obj.Description,
 obj.temp_double1,
 obj.temp_double2,
 obj.temp_string1,
 obj.temp_string2,
 obj.temp_string3,
 obj.temp_int1,
 obj.temp_int2,
 obj.temp_int3,
 obj.CreatedByUser,
 obj.CreatedDate,
 obj.UpdatedByUser,
 obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteNguyenNhanChinh(int ModuleId, int NguyenNhanChinhId)
        {
            DataProvider.Instance().DeleteNguyenNhanChinh(ModuleId, NguyenNhanChinhId);
        }

        public NguyenNhanChinhInfo GetNguyenNhanChinh(int ModuleId, int NguyenNhanChinhId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.NguyenNhanChinhInfo>(DataProvider.Instance().GetNguyenNhanChinh(ModuleId, NguyenNhanChinhId));
        }

        public List<NguyenNhanChinhInfo> GetNguyenNhanChinhs(int ModuleId)
        {
            return CBO.FillCollection<NguyenNhanChinhInfo>(DataProvider.Instance().GetNguyenNhanChinhs(ModuleId));
        }

        public void UpdateNguyenNhanChinh(NguyenNhanChinhInfo obj)
        {
            //   if (obj.NguyenNhanChinhName.Trim() != "")
            {
                DataProvider.Instance().UpdateNguyenNhanChinh(obj.ModuleId,

                obj.id,
obj.code,
obj.title,

obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<NguyenNhanChinhInfo> GetNguyenNhanChinhsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<NguyenNhanChinhInfo>(DataProvider.Instance().GetNguyenNhanChinhsByCond(ModuleId, Cond, Sql));
        }

        // nganh kinh te

     
        // Yeu to chan thuong


        public void AddYTGChanThuong(Triax.Modules.ThongKeATLD.YTGChanThuongInfo obj)
        {
            //  if (obj.YTGChanThuongName.Trim() != "")
            {
                DataProvider.Instance().AddYTGChanThuong(obj.ModuleId,

 obj.code,
 obj.title,
 obj.ParentId,
 obj.Description,
 obj.temp_double1,
 obj.temp_double2,
 obj.temp_string1,
 obj.temp_string2,
 obj.temp_string3,
 obj.temp_int1,
 obj.temp_int2,
 obj.temp_int3,
 obj.CreatedByUser,
 obj.CreatedDate,
 obj.UpdatedByUser,
 obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteYTGChanThuong(int ModuleId, int YTGChanThuongId)
        {
            DataProvider.Instance().DeleteYTGChanThuong(ModuleId, YTGChanThuongId);
        }

        public YTGChanThuongInfo GetYTGChanThuong(int ModuleId, int YTGChanThuongId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.YTGChanThuongInfo>(DataProvider.Instance().GetYTGChanThuong(ModuleId, YTGChanThuongId));
        }

        public List<YTGChanThuongInfo> GetYTGChanThuongs(int ModuleId)
        {
            return CBO.FillCollection<YTGChanThuongInfo>(DataProvider.Instance().GetYTGChanThuongs(ModuleId));
        }

        public void UpdateYTGChanThuong(YTGChanThuongInfo obj)
        {
            //   if (obj.YTGChanThuongName.Trim() != "")
            {
                DataProvider.Instance().UpdateYTGChanThuong(obj.ModuleId,

                obj.id,
obj.code,
obj.title,
obj.ParentId,
obj.Description,
obj.temp_double1,
obj.temp_double2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                );
            }
        }

        public List<YTGChanThuongInfo> GetYTGChanThuongsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<YTGChanThuongInfo>(DataProvider.Instance().GetYTGChanThuongsByCond(ModuleId, Cond, Sql));
        }



        // Thong ke ADLT CoSo


        public void AddThongKeATLDCoSo(Triax.Modules.ThongKeATLD.ThongKeATLDCoSoInfo obj)
        {
            //  if (obj.ThongKeATLDCoSoName.Trim() != "")
            {
                DataProvider.Instance().AddThongKeATLDCoSo(obj.ModuleId,

 
obj.ThongKeId,
obj.MaSo,
obj.TongSoCoSo,
obj.SoCoSoThamGiaBaoCao,
obj.TongSoLD,
obj.SoLDThamGiaBC,
obj.SoLDNu,
obj.SoVuTongSo,
obj.SoNguoiChet,
obj.SoNguoiBiThuongNang,
(decimal)obj.TanXuatTNLD,
(decimal)obj.TanXuatChet,
obj.GhiChu,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteThongKeATLDCoSo(int ModuleId, int ThongKeATLDCoSoId)
        {
            DataProvider.Instance().DeleteThongKeATLDCoSo(ModuleId, ThongKeATLDCoSoId);
        }

        public ThongKeATLDCoSoInfo GetThongKeATLDCoSo(int ModuleId, int ThongKeATLDCoSoId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.ThongKeATLDCoSoInfo>(DataProvider.Instance().GetThongKeATLDCoSo(ModuleId, ThongKeATLDCoSoId));
        }

        public List<ThongKeATLDCoSoInfo> GetThongKeATLDCoSos(int ModuleId)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().GetThongKeATLDCoSos(ModuleId));
        }

        public void UpdateThongKeATLDCoSo(ThongKeATLDCoSoInfo obj)
        {
            //   if (obj.ThongKeATLDCoSoName.Trim() != "")
            {
                DataProvider.Instance().UpdateThongKeATLDCoSo(obj.ModuleId,

                obj.Id,
obj.ThongKeId,
obj.MaSo,
obj.TongSoCoSo,
obj.SoCoSoThamGiaBaoCao,
obj.TongSoLD,
obj.SoLDThamGiaBC,
obj.SoLDNu,
obj.SoVuTongSo,
obj.SoNguoiChet,
obj.SoNguoiBiThuongNang,
(decimal)obj.TanXuatTNLD,
(decimal)obj.TanXuatChet,
obj.GhiChu,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate
                );
            }
        }

        public List<ThongKeATLDCoSoInfo> GetThongKeATLDCoSosByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().GetThongKeATLDCoSosByCond(ModuleId, Cond, Sql));
        }



        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBC(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBC(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        // nguyen nhan
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBCNN(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBCNN(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        // Bao cao tong hop bieu 5
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBC5(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBC5(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBC51(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBC51(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }

        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBC5_SUM(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBC5_SUM(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBC51_SUM(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBC51_SUM(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        // Nghe nghiep
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBCNgheNghiep(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBCNgheNghiep(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }

        // Yeu to chan thuong
        public List<ThongKeATLDCoSoInfo> getSelectDetailTonghopBCYTCT(int @LoaiThoiGianThongKe, int @NamThongKe, int @MaTinhThongKe)
        {
            return CBO.FillCollection<ThongKeATLDCoSoInfo>(DataProvider.Instance().getSelectDetailTonghopBCYTCT(@LoaiThoiGianThongKe, @NamThongKe, @MaTinhThongKe));
        }
        // thong ke ADLD chi tiet


        public void AddThongKeATLDDetail(Triax.Modules.ThongKeATLD.ThongKeATLDDetailInfo obj)
        {
            //  if (obj.ThongKeATLDDetailName.Trim() != "")
            {
                DataProvider.Instance().AddThongKeATLDDetail(obj.ModuleId,


obj.ThongKeId,
obj.MaSo,
obj.SoVuTongSo,
obj.SoVuCoNguoiChet,
obj.SoVuCo2NguoiBiNan,
obj.NguoiBiNanTongSo,
obj.NguoiBiNanSoLDNu,
obj.NguoiBiNanSoNguoiChet,
obj.NguoiBiNanNguoiBiThuongNang,
obj.ThietHaiTongSoNgayNghi,
obj.ThietHaiChiPhiTongSo,
obj.ThietHaiChiPhiYTe,
obj.ThietHaiTraLuong,
obj.ThietHaiBoiThuongTroCap,
obj.ThietHaiTaiSan,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate


                 );
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteThongKeATLDDetail(int ModuleId, int ThongKeATLDDetailId)
        {
            DataProvider.Instance().DeleteThongKeATLDDetail(ModuleId, ThongKeATLDDetailId);
        }

        public ThongKeATLDDetailInfo GetThongKeATLDDetail(int ModuleId, int ThongKeATLDDetailId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.ThongKeATLDDetailInfo>(DataProvider.Instance().GetThongKeATLDDetail(ModuleId, ThongKeATLDDetailId));
        }

        public List<ThongKeATLDDetailInfo> GetThongKeATLDDetails(int ModuleId)
        {
            return CBO.FillCollection<ThongKeATLDDetailInfo>(DataProvider.Instance().GetThongKeATLDDetails(ModuleId));
        }

        public void UpdateThongKeATLDDetail(ThongKeATLDDetailInfo obj)
        {
            //   if (obj.ThongKeATLDDetailName.Trim() != "")
            {
                DataProvider.Instance().UpdateThongKeATLDDetail(obj.ModuleId,

               obj.Id,
obj.ThongKeId,
obj.MaSo,
obj.SoVuTongSo,
obj.SoVuCoNguoiChet,
obj.SoVuCo2NguoiBiNan,
obj.NguoiBiNanTongSo,
obj.NguoiBiNanSoLDNu,
obj.NguoiBiNanSoNguoiChet,
obj.NguoiBiNanNguoiBiThuongNang,
obj.ThietHaiTongSoNgayNghi,
obj.ThietHaiChiPhiTongSo,
obj.ThietHaiChiPhiYTe,
obj.ThietHaiTraLuong,
obj.ThietHaiBoiThuongTroCap,
obj.ThietHaiTaiSan,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate
                );
            }
        }

        public List<ThongKeATLDDetailInfo> GetThongKeATLDDetailsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<ThongKeATLDDetailInfo>(DataProvider.Instance().GetThongKeATLDDetailsByCond(ModuleId, Cond, Sql));
        }

        // Thong ke ATLD


        public void AddThongKeATLD(Triax.Modules.ThongKeATLD.ThongKeATLDInfo obj)
        {
            //  if (obj.ThongKeATLDName.Trim() != "")
            {
                DataProvider.Instance().AddThongKeATLD(obj.ModuleId,

obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 );
            }
        }

        public ThongKeATLDInfo AddThongKeATLD1(Triax.Modules.ThongKeATLD.ThongKeATLDInfo obj)
        {
            //  if (obj.ThongKeATLDName.Trim() != "")
            {
                return CBO.FillObject < Triax.Modules.ThongKeATLD.ThongKeATLDInfo > (DataProvider.Instance().AddThongKeATLD1(obj.ModuleId,

obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 ));
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteThongKeATLD(int ModuleId, int ThongKeATLDId)
        {
            DataProvider.Instance().DeleteThongKeATLD(ModuleId, ThongKeATLDId);
        }

        public ThongKeATLDInfo GetThongKeATLD(int ModuleId, int ThongKeATLDId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.ThongKeATLDInfo>(DataProvider.Instance().GetThongKeATLD(ModuleId, ThongKeATLDId));
        }

        public List<ThongKeATLDInfo> GetThongKeATLDs(int ModuleId)
        {
            return CBO.FillCollection<ThongKeATLDInfo>(DataProvider.Instance().GetThongKeATLDs(ModuleId));
        }

        public void UpdateThongKeATLD(ThongKeATLDInfo obj)
        {
            //   if (obj.ThongKeATLDName.Trim() != "")
            {
                DataProvider.Instance().UpdateThongKeATLD(obj.ModuleId,

               obj.ThongKeId,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                );
            }
        }

        public List<ThongKeATLDInfo> GetThongKeATLDsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<ThongKeATLDInfo>(DataProvider.Instance().GetThongKeATLDsByCond(ModuleId, Cond, Sql));
        }

        public List<UserReportInfo> GetUsersByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<UserReportInfo>(DataProvider.Instance().GetUsersByCond(ModuleId, Cond, Sql));
        }

        public SoVuTNLDReportInfo GetSoVuTNLDReport(int loai, int nam)
        {
            return CBO.FillObject<SoVuTNLDReportInfo>(DataProvider.Instance().GetSoVuTNLDReport(loai, nam));
        }

        public List<TinhHinhTNLDReport> GeTinhHinhTNLDReport(int loai, int nam)
        {
            return CBO.FillCollection<TinhHinhTNLDReport>(DataProvider.Instance().GetTinhHinhTNLDReport(loai, nam));
        }

        public void DeleteCustomerNewcom(int ModuleId, int DocumentId)
        {
            DataProvider.Instance().DeleteCustomerNewcom(ModuleId, DocumentId);
        }


        public List<SoSanhTinhHinhTNLDReport> GeSoSanhTinhHinhTNLDReport(int loai, int nam,int namcungky)
        {
            return CBO.FillCollection<SoSanhTinhHinhTNLDReport>(DataProvider.Instance().GetSoSanhTinhHinhTNLDReport(loai, nam,namcungky));
        }

        public List<SoSanhTinhHinhTNLDDiaPhuongReport> GetSoSanhTinhHinhTNLDDiaPhuongReport(int loai, int nam, int namcungky)
        {
            return CBO.FillCollection<SoSanhTinhHinhTNLDDiaPhuongReport>(DataProvider.Instance().GetSoSanhTinhHinhTNLDDiaPhuongReport(loai, nam, namcungky));
        }

        public List<NgheNghiepTNLDReport> GetNgheNghiepTNLDReport(int loai, int nam)
        {
            return CBO.FillCollection<NgheNghiepTNLDReport>(DataProvider.Instance().GetNgheNghiepTNLDReport(loai, nam));
        }

        public List<YeuToChanThuongTNLDReport> GetYeuToChanThuongTNLDReport(int loai, int nam)
        {
            return CBO.FillCollection<YeuToChanThuongTNLDReport>(DataProvider.Instance().GetGetYeuToChanThuongTNLDReport(loai, nam));
        }

        public List<CongTacTKTNLDReport> GetCongTacTKTNLDReport(int loai, int nam, int namcungky)
        {
            return CBO.FillCollection<CongTacTKTNLDReport>(DataProvider.Instance().GetCongTacTKTNLDReport(loai, nam, namcungky));
        }


        public List<ThietHaiTNLDReport> GetThietHaiTNLDReport(int loai, int nam, int namcungky)
        {
            return CBO.FillCollection<ThietHaiTNLDReport>(DataProvider.Instance().GetThietHaiTNLDReport(loai, nam, namcungky));
        }
        
    //--------------------------------------------------------------
        public void AddThongKeATLDCS(Triax.Modules.ThongKeATLD.ThongKeATLDCSInfo obj)
        {
            //  if (obj.ThongKeATLDCSName.Trim() != "")
            {
                DataProvider.Instance().AddThongKeATLDCS(obj.ModuleId,


obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 );
            }
        }

        public ThongKeATLDCSInfo AddThongKeATLDCS1(Triax.Modules.ThongKeATLD.ThongKeATLDCSInfo obj)
        {
            //  if (obj.ThongKeATLDCSName.Trim() != "")
            {
                return CBO.FillObject<Triax.Modules.ThongKeATLD.ThongKeATLDCSInfo>(DataProvider.Instance().AddThongKeATLDCS1(obj.ModuleId,

obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 ));
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteThongKeATLDCS(int ModuleId, int ThongKeATLDCSId)
        {
            DataProvider.Instance().DeleteThongKeATLDCS(ModuleId, ThongKeATLDCSId);
        }

        public ThongKeATLDCSInfo GetThongKeATLDCS(int ModuleId, int ThongKeATLDCSId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.ThongKeATLDCSInfo>(DataProvider.Instance().GetThongKeATLDCS(ModuleId, ThongKeATLDCSId));
        }

        public List<ThongKeATLDCSInfo> GetThongKeATLDCSs(int ModuleId)
        {
            return CBO.FillCollection<ThongKeATLDCSInfo>(DataProvider.Instance().GetThongKeATLDCSs(ModuleId));
        }

        public void UpdateThongKeATLDCS(ThongKeATLDCSInfo obj)
        {
            //   if (obj.ThongKeATLDCSName.Trim() != "")
            {
                DataProvider.Instance().UpdateThongKeATLDCS(obj.ModuleId,

              obj.ThongKeId,
obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate




                );
            }
        }

        public List<ThongKeATLDCSInfo> GetThongKeATLDCSsByCond(int ModuleId, string Cond, string Sql)
        {
            return CBO.FillCollection<ThongKeATLDCSInfo>(DataProvider.Instance().GetThongKeATLDCSsByCond(ModuleId, Cond, Sql));
        }

        // bao cao nhanh
        public void AddBaoCaoNhanh(Triax.Modules.ThongKeATLD.BaoCaoNhanhInfo obj)
        {
            //  if (obj.BaoCaoNhanhName.Trim() != "")
            {
                DataProvider.Instance().AddBaoCaoNhanh(obj.ModuleId,


obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 );
            }
        }

        public BaoCaoNhanhInfo AddBaoCaoNhanh1(Triax.Modules.ThongKeATLD.BaoCaoNhanhInfo obj)
        {
            //  if (obj.BaoCaoNhanhName.Trim() != "")
            {
                return CBO.FillObject<Triax.Modules.ThongKeATLD.BaoCaoNhanhInfo>(DataProvider.Instance().AddBaoCaoNhanh1(obj.ModuleId,

obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate



                 ));
            }
        }

        /// -----------------------------------------------------------------------------
        public void DeleteBaoCaoNhanh(int ModuleId, int BaoCaoNhanhId)
        {
            DataProvider.Instance().DeleteBaoCaoNhanh(ModuleId, BaoCaoNhanhId);
        }

        public BaoCaoNhanhInfo GetBaoCaoNhanh(int ModuleId, int BaoCaoNhanhId)
        {
            return CBO.FillObject<Triax.Modules.ThongKeATLD.BaoCaoNhanhInfo>(DataProvider.Instance().GetBaoCaoNhanh(ModuleId, BaoCaoNhanhId));
        }

        public List<BaoCaoNhanhInfo> GetBaoCaoNhanhs(int ModuleId)
        {
            return CBO.FillCollection<BaoCaoNhanhInfo>(DataProvider.Instance().GetBaoCaoNhanhs(ModuleId));
        }

        public void UpdateBaoCaoNhanh(BaoCaoNhanhInfo obj)
        {
            //   if (obj.BaoCaoNhanhName.Trim() != "")
            {
                DataProvider.Instance().UpdateBaoCaoNhanh(obj.ModuleId,

              obj.ThongKeId,
obj.TenDV,
obj.DiaChi,
obj.MaQuanHuyen,
obj.TenQuanHuyen,
obj.MaLoaiHinhDoanhNghiep,
obj.TenLoaiHinhDoanhNghiep,
obj.MaNganhKT,
obj.TenNganhKT,
obj.TongSoLDCoSo,
obj.SoLDNu,
obj.TongQuyLuong,
obj.TongSoNgayNghiTNLD,
obj.TongTienChiPhi,
obj.CSYte,
obj.CSTraLuong,
obj.CSBoiDuong_TroCap,
obj.NguoiBC,
obj.LoaiThoiGianThongKe,
obj.LoaiChiTieuThongKe,
obj.MaTinhThongKe,
obj.NamThongKe,
obj.Creator,
obj.Created,
obj.Modifier,
obj.Modified,
obj.StatusId,
obj.LoaiThongKe,
obj.temp_dou1,
obj.temp_dou2,
obj.temp_string1,
obj.temp_string2,
obj.temp_string3,
obj.temp_int1,
obj.temp_int2,
obj.temp_int3,
obj.CreatedByUser,
obj.CreatedDate,
obj.UpdatedByUser,
obj.UpdatedDate




                );
            }
        }

        public List<BaoCaoNhanhInfo> GetBaoCaoNhanhsByCond(int id,string Cond, string Sql)
        {
            return CBO.FillCollection<BaoCaoNhanhInfo>(DataProvider.Instance().GetBaoCaoNhanhsByCond(id,Cond, Sql));
        }

        public List<BaoCaoNhanhReport> GetTongHopBaoCaoNhanh(string Cond, string Sql)
        {
            return CBO.FillCollection<BaoCaoNhanhReport>(DataProvider.Instance().GetTongHopBaoCaoNhanh(Cond, Sql));
        }

        public List<BaoCaoNhanhReport> GetTongHopBaoCaoNhanhOrder(string Cond, string Sql, string order)
        {
            return CBO.FillCollection<BaoCaoNhanhReport>(DataProvider.Instance().GetTongHopBaoCaoNhanhOrder(Cond, Sql, order));
        }

        public List<TKTNLDDetailAllReport> getTKTNLDDetailAllReport(int LoaiThoiGianThongKe, string NamThongKe, int LoaiChiTieuThongKe, string MaTinhThongKe)
        {
            return CBO.FillCollection<TKTNLDDetailAllReport>(DataProvider.Instance().getTKTNLDDetailAllReport(LoaiThoiGianThongKe, NamThongKe, LoaiChiTieuThongKe, MaTinhThongKe));
        }
        public ThongKeATLDCSInfo Tonghopthiethai(int LoaiThoiGianThongKe, int NamThongKe, int LoaiChiTieuThongKe)
        {
            return CBO.FillObject<ThongKeATLDCSInfo>(DataProvider.Instance().Tonghopthiethai(LoaiThoiGianThongKe, NamThongKe, LoaiChiTieuThongKe));
        }


    #endregion

    #region Optional Interfaces

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// GetSearchItems implements the ISearchable Interface
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo)
        {
            SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection();
            //List<CategoryInfo> colCategorys  = GetCategorys(ModInfo.ModuleID);

            //foreach (CategoryInfo objCategory in colCategorys)
            //{
            //    if(objCategory != null)
            //    {
            //        SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objCategory.CategoryName, objCategory.CreatedByUser, objCategory.CreatedDate, ModInfo.ModuleID, objCategory.CategoryId.ToString(), objCategory.CategoryName, "CategoryId=" + objCategory.CategoryId.ToString());
            //        SearchItemCollection.Add(SearchItem);
            //    }
            //}

            return SearchItemCollection;
        }


        /// -----------------------------------------------------------------------------
        /// <summary>
        /// ExportModule implements the IPortable ExportModule Interface
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="ModuleID">The Id of the module to be exported</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public string ExportModule(int ModuleID)
        {
            string strXML = "";
            //List<CategoryInfo> colCategorys  = GetCategorys(ModuleID);

            //if (colCategorys.Count != 0)
            //{
            //    strXML += "<Categorys>";
            //    foreach (CategoryInfo objCategory in colCategorys)
            //    {
            //        strXML += "<Category>";
            //        strXML += "<CategoryName>" + XmlUtils.XMLEncode(objCategory.CategoryName) + "</CategoryName>";
            //        strXML += "</Category>";
            //    }
            //    strXML += "</Categorys>";
            //}

            return strXML;
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// ImportModule implements the IPortable ImportModule Interface
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="ModuleID">The Id of the module to be imported</param>
        /// <param name="CategoryName">The CategoryName to be imported</param>
        /// <param name="Version">The version of the module to be imported</param>
        /// <param name="UserId">The Id of the user performing the import</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------

        public void ImportModule(int ModuleID, string Content, string Version, int UserId)
        {
            XmlNode xmlCSDLAnhHiens = Globals.GetContent(Content, "CSDLAnhHiens");

            //foreach (XmlNode xmlCSDLAnhHien in xmlCSDLAnhHiens.SelectNodes("CSDLAnhHien"))
            //{
            //    CSDLAnhHienInfo objCSDLAnhHien = new CSDLAnhHienInfo();

            //    objCSDLAnhHien.ModuleId = ModuleID;
            //    //  objCSDLAnhHien.Content = xmlCSDLAnhHien.SelectSingleNode("content").InnerText;
            //    objCSDLAnhHien.CreatedByUser = UserId;
            //    AddCSDLAnhHien(objCSDLAnhHien);
            //}

        }

    #endregion

    }
}

